<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="../org/angular.min.js"></script>
</head>
<body>
<div ng-app="hd" ng-controller="ctrl">
    <h2>{{name}}</h2>
    <h1 ng-bind="name"></h1>
    <!--ng-model进行双向绑定 -->
    <input type="text" ng-model="name">
</div>


<script>
    var m = angular.module('hd', []);
    m.controller('ctrl', ['$scope', function ($scope) {
        /*定义变量*/
        $scope.name = '后盾网';
        /*定义数组*/
        $scope.arry=[1,2,3];
        $scope.arry1=[{key:1, value:111}, {key:2, value:222}, {key:2, value:222}];
        /*定义对象*/
        $scope.obj ={
            name:'heyufeng',
            data:{key:1,value:'aaa'}
        };
        /*定义函数*/
        $scope.func =function () {
            alert(1);
        };
    }]);
</script>

</body>
</html>

